From 1dfba95328bcb162dface311c501a3c2cf365157 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Tue, 27 Mar 2007 19:07:05 +0000 Subject: [PATCH] Beef up the Special:Log search form so it's laid out a bit clearer; clarified English text for the prefix/wildcard thing --- includes/SpecialLog.php | 60 +++++++++++-------------------- languages/messages/MessagesEn.php | 4 ++- maintenance/language/messages.inc | 4 ++- 3 files changed, 27 insertions(+), 41 deletions(-) diff --git a/includes/SpecialLog.php b/includes/SpecialLog.php index 9c556962cc..55b9e4e500 100644 --- a/includes/SpecialLog.php +++ b/includes/SpecialLog.php @@ -401,19 +401,28 @@ class LogViewer { */ function showOptions( &$out ) { global $wgScript, $wgMiserMode; - $action = htmlspecialchars( $wgScript ); $title = SpecialPage::getTitleFor( 'Log' ); - $special = htmlspecialchars( $title->getPrefixedDBkey() ); - $out->addHTML( "
\n" . - '
' . - Xml::element( 'legend', array(), wfMsg( 'log' ) ) . - Xml::hidden( 'title', $special ) . "\n" . - $this->getTypeMenu() . "\n" . - $this->getUserInput() . "\n" . - $this->getTitleInput() . "\n" . - (!$wgMiserMode?($this->getTitlePattern()."\n"):"") . - Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" . - "
" ); + $form = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ); + $form .= Xml::hidden( 'title', $title->getPrefixedDBkey() ); + $form .= '
' . wfMsgHtml( 'log-search-legend' ) . ''; + $form .= ''; + # Log selection + $form .= ''; + $form .= ''; + # User filter + $form .= ''; + # Title filter + $form .= ''; + $form .= ''; + # Title "wildcard" checkbox (if enabled) + if( !$wgMiserMode ) { + $form .= ''; + } + $form .= ''; + $form .= '
 ' . $this->getTypeMenu() . '
' . Xml::label( wfMsg( 'specialloguserlabel' ), 'user' ) . '' . Xml::input( 'user', 30, $this->reader->queryUser(), array( 'id' => 'user' ) ) . '
' . Xml::label( wfMsg( 'speciallogtitlelabel' ), 'page' ) . '' . Xml::input( 'page', 30, $this->reader->queryTitle(), array( 'id' => 'page' ) ) . '
 ' . Xml::checkLabel( wfMsg( 'log-title-wildcard' ), 'pattern', 'pattern', $this->reader->queryPattern() ) . '
 ' . Xml::submitButton( wfMsg( 'log-search-submit' ) ) . '
'; + $form .= '
'; + $form .= ''; + $out->addHtml( $form ); } /** @@ -445,33 +454,6 @@ class LogViewer { return $out; } - /** - * @return string Formatted HTML - * @private - */ - function getUserInput() { - $user = $this->reader->queryUser(); - return Xml::inputLabel( wfMsg( 'specialloguserlabel' ), 'user', 'user', 12, $user ); - } - - /** - * @return string Formatted HTML - * @private - */ - function getTitleInput() { - $title = $this->reader->queryTitle(); - return Xml::inputLabel( wfMsg( 'speciallogtitlelabel' ), 'page', 'page', 20, $title ); - } - - /** - * @return boolean Checkbox - * @private - */ - function getTitlePattern() { - $pattern = $this->reader->queryPattern(); - return Xml::checkLabel( wfMsg( 'title-pattern' ), 'pattern', 'pattern', $pattern ); - } - /** * @param OutputPage &$out where to send output * @private diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 43fbbccdda..d3f51fee85 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1607,10 +1607,12 @@ further information about books you are looking for:', 'specialloguserlabel' => 'User:', 'speciallogtitlelabel' => 'Title:', 'log' => 'Logs', +'log-search-legend' => 'Search for logs', +'log-search-submit' => 'Go', 'alllogstext' => 'Combined display of all available logs of {{SITENAME}}. You can narrow down the view by selecting a log type, the user name, or the affected page.', 'logempty' => 'No matching items in log.', -'title-pattern' => 'Title starts with …', +'log-title-wildcard' => 'Search titles starting with this text', # Special:Allpages 'nextpage' => 'Next page ($1)', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index c23f394850..cc95a190f3 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -1002,9 +1002,11 @@ $wgMessageStructure = array( 'specialloguserlabel', 'speciallogtitlelabel', 'log', + 'log-search-legend', + 'log-search-submit', 'alllogstext', 'logempty', - 'title-pattern', + 'log-title-wildcard', ), 'allpages' => array( 'nextpage', -- 2.20.1